package com.hna.eking.AirGisPlt.Main;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;



@Controller
@SpringBootApplication
@ComponentScan({"com.hna.eking.AirGisPlt.Controller", "com.hna.eking.AirGisPlt.Rest"})
//@ServletComponentScan({"com.hna.eking.controller"})
public class App extends SpringBootServletInitializer
{
    public static void main( String[] args )
    {
    	 System.out.println( "App Run Start....." );
         SpringApplication app = new SpringApplication(App.class);  
 		app.run(args);
    }
    
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        // 注意这里要指向原先用main方法执行的Application启动类
        return builder.sources(App.class);
    }
    
    @RequestMapping("/")
   	public String home(Model model) {
   		return "index";	
   	}
}
